package forum.communication;

import java.util.Vector;

import forum.server.controller.ForumFacadeInt;
import forum.server.exceptions.DatabaseException;

public class GetAllUsersMessage extends ClientMessage{

	/**
	 * 
	 */
	private static final long serialVersionUID = 4564212250731140266L;

	@Override
	public ServerResponse doOperation(ForumFacadeInt forum) {
		Vector<String> users = null;
		try {
			users = forum.getModerators();
		} catch (DatabaseException e) {
			return new ServerResponse("The server is currently down for maintanance.\nPlease try again later.",false);			
		}
		String res="";
		for(String str:users){
			res+=str+",";
		}
		return new ServerResponse(res,true);
	}

}
